
let User = sequelize.define('user', {
    id: {
      field: 'id',
      primaryKey: true,
      type: Sequelize.INTEGER(11).UNSIGNED,
      allowNull: false
    },
    avatar: {
      field: 'avatar',
      type: Sequelize.STRING,
      allowNull: true
    },
    name: {
      field: 'name',
      type: Sequelize.STRING,
      allowNull: false
    },
    email: {
      field: 'email',
      type: Sequelize.STRING,
      allowNull: false
    },
    phone: {
      field: 'phone',
      type: Sequelize.STRING,
      allowNull: false
    },
    sex: {
      field: 'sex',
      type: Sequelize.INTEGER(1).UNSIGNED,
      allowNull: false
    },
    password: {
      field: 'password',
      type: Sequelize.STRING,
      allowNull: false
    },
    role_level: {
      field: 'role_level',
      type: Sequelize.INTEGER(11).UNSIGNED,
      allowNull: false
    },
    updated_at: {
      field: 'updated_at',
      type: Sequelize.INTEGER(11).UNSIGNED,
      allowNull: false
    },
    created_at: {
      field: 'created_at',
      type: Sequelize.INTEGER(11).UNSIGNED,
      allowNull: false
    }
  },
  {
    tableName: 'user',
    timestamps: false,
    freezeTableName: true
  }
);

module.exports.User = User;
